#include <iostream>
using namespace std;

class A{};
class B:public A{};
class Base {
public:
	virtual void foo (int a = 0) const {
	//virtual void foo (void) const {
		cout << "Base::foo()" << endl;
	}
	virtual A* bar (void) {
	//virtual void bar (void) {
		cout << "Base::bar()" << endl;
	}
};
class Derived:public Base {
	virtual void foo (int b = 0) const {
	//void foo (void) const {
		cout << "Derived::foo()" << endl;
	}

	B* bar (void) {
	//int bar (void) { //error
		cout << "Derived::bar()" << endl;
	}
};

int main (void)
{
	Derived d;
	Base *pb = &d; 
	pb->foo();
	pb->bar();
	return 0;
}
